package com.etcn.modules.statical.base.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.etcn.common.controller.BaseController;
import com.etcn.modules.statical.base.pojo.BaseCountry;
import com.etcn.modules.statical.base.service.IBaseCountryService;

import org.springframework.web.bind.annotation.ResponseBody;
import com.etcn.common.annotation.Manage;

/**
 * 国家controller
 * @author guozc
 * @date: 2018-01-12 09:26:26
 */
@Controller
@RequestMapping("/v1/base")
public class BaseCountryController extends BaseController {

	@Autowired
    private IBaseCountryService baseCountryService;
	
	 /**
     * 查询国家按字母排序列表
     */
    @Manage
    @RequestMapping(value = "countrysdir", method = RequestMethod.GET)
    public @ResponseBody Object countrysdir(BaseCountry baseCountry) throws Exception{
    	return baseCountryService.findCountrysDir(baseCountry);
    }

     /**
     * 查询国家列表
     */
    @Manage
    @RequestMapping(value = "countrys", method = RequestMethod.GET)
    public @ResponseBody Object countrys(BaseCountry baseCountry) throws Exception{
    	return baseCountryService.findList(baseCountry);
    }
    
    /**
     * 查询国家详情
     */
    @Manage
    @RequestMapping(value = "countrys/{id}", method = RequestMethod.GET)
    public @ResponseBody Object detail(@PathVariable("id") long id) throws Exception{
    	return baseCountryService.detail(id);
    }
    
}